<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>jsp中域对象的使用</title>
</head>
<body>

<%--
    四大域对象                           作用范围
    pageContext                       当前页有效
    request                         一次请求有效
    session                         一次会话有效
    application                     整个应用有效
--%>
<%
    pageContext.setAttribute("pc", "pageContext");
    request.setAttribute("request", "request");
    session.setAttribute("session", "session");
    application.setAttribute("application", "application");
%>

<h1>获取域对象中的值</h1>
<p>pageContext:<%=pageContext.getAttribute("pc")%></p>
<p>request:<%=request.getAttribute("request")%></p>
<p>session:<%=session.getAttribute("session")%></p>
<p>application:<%=application.getAttribute("application")%></p>


<%--<a href="scop2.jsp">跳转scop2.jsp</a>--%>
<%--转发页面到scop2--%>
<jsp:forward page="scop2.jsp"/>

</body>
</html>
